<jsp:include page="/vista/ittsa/busbannersup.jsp"></jsp:include>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="WEB-INF/struts-html" prefix="html"%>
<%@ taglib uri="WEB-INF/struts-logic" prefix="logic"%>
<%@ taglib uri="WEB-INF/struts-bean" prefix="bean"%>
<%@ taglib uri="WEB-INF/struts-nested.tld" prefix="nested"%>
<%@ taglib uri="WEB-INF/displaytag" prefix="display"%>
<%@ page import="java.util.*"%>
<%@ page import="java.lang.*"%>
<%@page import="pe.com.certicom.ittsa.model.bean.*"%>
<%@page import="pe.com.certicom.ittsa.control.action.*"%>
<%@page import="pe.com.certicom.ittsa.control.form.*"%>
<html>
<head>
<link href="vista/css/table.css" type="text/css" rel="stylesheet"></link>
<script type="text/javascript" src="vista/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
	function irMenuDispAsiento() {
		document.getElementsByName("method")[0].value = "11";
		document.forms[0].submit();
		return true;
	}

	function irSeleccionAsiento(origen, destino, fecha, hora, servicio,	precio1,precio2) {
		document.getElementsByName("method")[0].value = "14";
		document.getElementsByName("origen")[0].value = origen;
		document.getElementsByName("destino")[0].value = destino;
		document.getElementsByName("fecha")[0].value = fecha;
		document.getElementsByName("hora")[0].value = hora;
		document.getElementsByName("servicio")[0].value = servicio;
		document.getElementsByName("precio1")[0].value = precio1;
		document.getElementsByName("precio2")[0].value = precio2;
		document.forms[0].submit();
		return true;
	}
	 $(document).ready(function(){
		   $(".reportetr").mouseover(function(){$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");});
		   $(".reporte tr:even").addClass("odd");
		 });
	 
		
	   
</script>
</head>
<body>
	<div id="content">
		<br />
		<html:form action="/CompraPasaje.do" method="post"
			enctype="multipart/form-data">
			<input type="hidden" name="method" />
			<input type="hidden" name="origen" />
			<input type="hidden" name="destino" />
			<input type="hidden" name="fecha" />
			<input type="hidden" name="hora" />
			<input type="hidden" name="servicio" />
			<input type="hidden" name="precio1" />
			<input type="hidden" name="precio2" />
			<%
				int ctr = 1;
			%>
			<h1>Compra de Pasajes</h1>
			<br>
			<div id="scroll">
				<table class="reporte">
					<logic:present name="CompraPasajeForm"
						property="listaReporteDispAsiento">
						<thead>
							<tr>
								<th width="5%">No</th>
								<th width="25%">Servicio</th>
								<th width="10%">Origen</th>
								<th width="15%">Destino</th>
								<th width="10%">Hora</th>
								<th width="10%">Precio Piso 1</th>
								<th width="10%">Precio Piso 2</th>
								<th width="5%">Asientos Disponibles</th>
								
							</tr>
						</thead>
						<logic:iterate name="CompraPasajeForm"
							property="listaReporteDispAsiento" id="rep"
							type="pe.com.certicom.ittsa.model.bean.ReporteDispAsientoBean">
							<tbody>
								<tr onclick="return irSeleccionAsiento('<bean:write name="rep" property="origen"/>','<bean:write name="rep" property="destino"/>','<bean:write name="rep" property="fecha"/>','<bean:write name="rep" property="hora"/>','<bean:write name="rep" property="servicio"/>','<bean:write name="rep" property="costo1ro"/>','<bean:write name="rep" property="costo2do"/>');"  >
									<td><%=ctr++%></td>
									<td><bean:write name="rep" property="servicio" /></td>
									<td><bean:write name="rep" property="origen" /></td>
									<td><bean:write name="rep" property="destino" /></td>
									<td><bean:write name="rep" property="hora" /></td>
									<td><bean:write name="rep" property="costo1ro" /></td>
									<td><bean:write name="rep" property="costo2do" /></td>
									<td class="fin"><bean:write name="rep" property="disponibles" /></td>
								</tr>
							</tbody>
						</logic:iterate>
					</logic:present>
				</table>
			</div>
			<br>
			<div align="center">
				<button onclick="return irMenuDispAsiento();" class="btnRegresar"></button>
			</div>
		</html:form>
	</div>
</body>
</html>